]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: Close windows using new layout manager API
authorJonas Dreßler <verdre@v0yd.nl>
Mon, 8 Jun 2020 12:50:23 +0000 (14:50 +0200)
committerJonas Dreßler <verdre@v0yd.nl>
Thu, 11 Jun 2020 18:49:31 +0000 (20:49 +0200)
Now that we have a new API to get all the windows and metaWindows from
our layout manager, implement the deleteAll() method of the window clone
using that API instead of looping through the children of the actor and
using the source of the ClutterClone.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298

js/ui/workspace.js

index c815ebec8b4ea21cf52503a19210bcf222ab6e12..ef34860da2bb7eec505f6ed4c79ec3e28d20f60d 100644 (file)
@@ -290,16 +290,15 @@ var WindowClone = GObject.registerClass({
     }
 
     deleteAll() {
+        const windows = this.layout_manager.getWindows();
+
         // Delete all windows, starting from the bottom-most (most-modal) one
-        let windows = this.get_children();
-        for (let i = windows.length - 1; i >= 1; i--) {
-            let realWindow = windows[i].source;
-            let metaWindow = realWindow.meta_window;
+        for (const window of windows.reverse()) {
+            const metaWindow = this.layout_manager.getMetaWindow(window);
 
             metaWindow.delete(global.get_current_time());
         }
 
-        this.metaWindow.delete(global.get_current_time());
         this._closeRequested = true;
     }